#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
# -*- mode: python; -*-

Import('BuildEnv')
import os

env = BuildEnv.Clone()
env.Append(CPPPATH = env['TOP'])
env.Append(CPPPATH = [env['TOP'] + '/ifmap'])
env.Append(CPPPATH = [env['TOP'] + '/config-client-mgr'])
env.Append(CPPPATH = [env['TOP'] + '/base/sandesh'])
env.Append(CPPPATH = [env['TOP'] + '/database'])

etcd_incl = os.environ.get('CONTRAIL_ETCD_INCL');

if etcd_incl:
    env.Append(CXXFLAGS = '-Wno-deprecated-declarations -std=c++11')

env.Prepend(LIBS=['io', 'base', 'cassandra_cql', 'cassandra', 'gendb', 'SimpleAmqpClient', 'config_client_mgr'])

except_env = BuildEnv.Clone()
except_env.Append(CPPPATH = [env['TOP'] + '/ifmap'])
except_env.Append(CPPPATH = [env['TOP'] + '/config-client-mgr'])
except_env.Append(CPPPATH = [env['TOP'] + '/base/sandesh'])
except_env.CppEnableExceptions()
except_env.Append(CPPPATH = env['TOP'])

except_env = BuildEnv.Clone()
except_env.CppEnableExceptions()
except_env.Append(CPPPATH = env['TOP'])

libifmapio = env.Library('ifmapio',
                         ['config_json_parser.cc',
                         ])

env.Requires(libifmapio, '#build/lib/' + env['LIBPREFIX'] + 'SimpleAmqpClient' + env['LIBSUFFIX'])
env.Requires(libifmapio, '#/build/include/rapidjson.h')
env.Install(env['TOP_LIB'], libifmapio)

client_unit_tests = env.SConscript('test/SConscript', exports='BuildEnv',
                                   duplicate = 0)
Return('client_unit_tests')
